<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./js/jquery.js"></script>
  </head>
  <body>
    <button>发送请求</button>
    <ul>

    </ul>
    
    <script>
      $(function () {
        $("button").click(function () {
            $.ajax({
                url: "http://localhost:8080/data",
                type: "get",
                // data:{
                //   name:"丽丽",
                //   age:20
                // },
                success: function (res) {
                    console.log(res.obj);
                 let ul=   $("ul")
                 res.obj.forEach(function(val){
                    ul.append(`<li>${val.name}</li>`)
                    ul.append(`<li>${val.age}</li>`)
                    ul.append(`<li>${val.sex}</li>`)
                    ul.append(`<li>${val.address}</li>`)
                 })
                
                }
            })
          });

      
      });
    </script>
  </body>
</html>
